package com.daoeping.action;

import java.util.ArrayList;
import java.util.List;

import com.daoeping.data.Bsc_education;
import com.daoeping.data.Bsc_native;
import com.daoeping.domain.JsonData;
import com.daoeping.service.Bsc_educationService;
import com.daoeping.util.ConverntJsonData;
import com.opensymphony.xwork2.ActionSupport;

public class Bsc_educationAction extends ActionSupport{
	
	private static final long serialVersionUID = -5575850521061551730L;
	
	private Bsc_educationService bsc_educationService;
	private JsonData jsonData;
	private List<Bsc_education> bsc_educationList;
	
	public List<Bsc_education> getBsc_educationList() {
		return bsc_educationList;
	}

	public void setBsc_educationList(List<Bsc_education> bsc_educationList) {
		this.bsc_educationList = bsc_educationList;
	}

	public JsonData getJsonData() {
		return jsonData;
	}

	public void setJsonData(JsonData jsonData) {
		this.jsonData = jsonData;
	}

	public Bsc_educationService getBsc_educationService() {
		return bsc_educationService;
	}

	public void setBsc_educationService(Bsc_educationService bsc_educationService) {
		this.bsc_educationService = bsc_educationService;
	}

	public String findAllEducational(){
		jsonData = new JsonData();
		bsc_educationList = bsc_educationService.findBsc_educationList();
		List <String[]> strList = new ArrayList<String[]>();
		for (Bsc_education bsc_education : bsc_educationList) {
			String [] strarr = new String[2];
			strarr[1] = bsc_education.getId()+"";
			strarr[0] = bsc_education.getName();
			strList.add(strarr);
		}
		jsonData.setJsonData( new ConverntJsonData().getJsonData(strList)+"");
		return "alleducational";
		
	}
	
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public List<Bsc_education> findBsc_educationList() {
		return this.bsc_educationService.findBsc_educationList();
	}
}
